import time

import requests
import execjs
with open("sign.js","r",encoding="utf-8") as f:
    js_code=f.read()
js_com=execjs.compile(js_code)

headers = {
    "Accept": "application/json, text/plain, */*",
    "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,ar;q=0.7",
    "Cache-Control": "no-cache",
    "Connection": "keep-alive",
    "Content-Type": "application/json;charset=utf-8",
    "Pragma": "no-cache",
    "Referer": "https://www.cls.cn/depth?id=1000",
    "Sec-Fetch-Dest": "empty",
    "Sec-Fetch-Mode": "cors",
    "Sec-Fetch-Site": "same-origin",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0",
    "sec-ch-ua": "\"Not;A=Brand\";v=\"99\", \"Microsoft Edge\";v=\"139\", \"Chromium\";v=\"139\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\""
}
cookies = {
    "HWWAFSESTIME": "1754878289631",
    "HWWAFSESID": "c1021b54060aeb5d73",
    "hasTelegraphNotification": "on",
    "hasTelegraphRemind": "on",
    "hasTelegraphSound": "on",
    "vipNotificationState": "on",
    "tfstk": "gAOmBIsCRKWjr-PbnVfjhvsgk0DRGs113hFOX1IZUgS7DoFv7G0M7gdABso_sF8B0hXslGINjhLwH4hK9ETf11SivXhKAaxJUnVN0-ua4w7syZkWRqDR11oK2dwRcxf60zc1118rrNQO7r-N07lPVZ2V_iWa487F4G5wbGWz4wbUbSP2bUulWgy43hWqr_S571Swb1lxA5SH_QOrjbQFsbKc4QbcnM8od5VaBZrdxEuTs5RkEgIEvgVa_QbDS4jDoWDOYpsApgtrwSfMzNxh-nqrq18kGBXyg0NMx3vFZa9SjRjHQEpBQT0qgUfcm9AReryGid-Xst9052TPg39CAtkSVaAv9OjCEuo2yUjVKdxxV5SvKU-lpQE89_8eE_jz78yFslP1zVdzCR6VPajp_9ji-JDuzruorJMf3a_xv40uCR6VPajKr42Qct75kDC.."
}
url = "https://www.cls.cn/v3/depth/list/1000"
params = {
    "app": "CailianpressWeb",
    "id": "1000",
    "last_time": str(int(time.time())),
    "os": "web",
    "rn": "20",
    "sv": "8.4.6",
}
sign=js_com.call("get_sign",params)
print(sign)
params["sign"]=sign
response = requests.get(url, headers=headers, cookies=cookies, params=params)
print(response.status_code)
print(response.text)
